home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / ROLLDIAL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  78 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1995, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.4  $
  6. //
  7. //----------------------------------------------------------------------------
  8. #if !defined(OWL_ROLLDIAL_H)
  9. #define OWL_ROLLDIAL_H
  10.  
  11. #if !defined(OWL_DIALOG_H)
  12. # include <owl/dialog.h>
  13. #endif
  14.  
  15. #if defined(BI_NAMESPACE)
  16. namespace OWL {
  17. #endif
  18.  
  19. // Generic definitions/compiler options (eg. alignment) preceeding the 
  20. // definition of classes
  21. #include <services/preclass.h>
  22.  
  23. //
  24. // class TRollDialog
  25. // ~~~~~ ~~~~~~~~~~~
  26. // Allow a dialog to "roll" up and down, similar to the Corel interface.
  27. // This class is best used for modeless dialogs.
  28. //
  29. // When the dialog is created, a menuitem is appended to the system menu.
  30. // This menu choice will be either Shrink or Expand depending upon which
  31. // state the dialog is currently in.
  32. //
  33. // If the dialog contains minimize or maximize buttons, the behaviour
  34. // of those buttons map to shrink and expand respectively.
  35. //
  36. class _OWLCLASS TRollDialog : public TDialog {
  37.   public:
  38.     TRollDialog(TWindow* parent, TResId resId, bool animated = true,
  39.                 bool fullSize = true, TModule* module = 0);
  40.  
  41.     // Override virtuals
  42.     //
  43.     void SetupWindow();
  44.  
  45.   protected:
  46.     void Shrink();
  47.     void Expand();
  48.     void EvSysCommand(uint, TPoint&);
  49.     bool IsFullSize;          // track if the dialog is currently full size
  50.  
  51.   private:
  52.     // Will need some enums to know when the mouse is over the non-client
  53.     // button or when the user selects the system menu for rolling.
  54.     //
  55.     enum {
  56.       SC_ROLLDIALOG = 0xFF00,
  57.     };
  58.  
  59.     void Resize(bool currentlyFullSize);
  60.  
  61.     int  Height;
  62.     bool InitialFullSize;     // save constructor parameter
  63.     bool HasSystemMenu;
  64.     bool WantAnimation;
  65.  
  66.   DECLARE_RESPONSE_TABLE(TRollDialog);
  67. };
  68.  
  69. // Generic definitions/compiler options (eg. alignment) following the 
  70. // definition of classes
  71. #include <services/posclass.h>
  72.  
  73. #if defined(BI_NAMESPACE)
  74. } // namespace OWL
  75. #endif
  76.  
  77. #endif // OWL_ROLLDIAL_H
  78.